package com.nononsenseapps.feeder.net.obs.model

import com.google.gson.JsonObject
import com.squareup.moshi.JsonClass

@JsonClass(generateAdapter = true)
data class Note(val tags:Array<String>, val frontmatter:JsonObject, val stat: Stat, val path:String, val content:String) {


    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as Note

        if (!tags.contentEquals(other.tags)) return false
        if (frontmatter != other.frontmatter) return false
        if (stat != other.stat) return false
        if (path != other.path) return false
        if (content != other.content) return false

        return true
    }

    override fun hashCode(): Int {
        var result = tags.contentHashCode()
        result = 31 * result + frontmatter.hashCode()
        result = 31 * result + stat.hashCode()
        result = 31 * result + path.hashCode()
        result = 31 * result + content.hashCode()
        return result
    }

}

@JsonClass(generateAdapter = true)
data class Stat(val ctime:Number,val mtime:Number,val size:Number)
